package com.sy.olddriver.model;

import com.sy.olddriver.annotation.Controller;
import com.sy.olddriver.annotation.RequestMapping;
import com.sy.olddriver.annotation.ResponseBody;
import com.sy.olddriver.entity.Product;
import com.sy.olddriver.service.HistoryService;
import com.sy.olddriver.service.impl.HistoryServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
@RequestMapping("history")
public class HistoryModel {
    private HistoryService historyService = new HistoryServiceImpl();

    @RequestMapping("list")
    @ResponseBody
    public List<Product> list(HttpServletRequest req, HttpServletResponse res) {
        return historyService.getAllHistories(req, res);
    }
}
